import request from '@/utils/request'

// 实现新增部门
// @Parma {code,introduce,manager,name,pid} data
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 查询部门列表
// @Parma
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 实现修改部门
// @Parma {code,introduce,manager,name,pid,id} data
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 实现部门删除
// @Parma {code,introduce,manager,name,pid,id} data
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 根据id查询部门
// @Parma {code,introduce,manager,name,pid,id} data
export function getDepartmentsDetaill(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
